﻿using SQ.Domain;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SQ.Infrastructure.Mappings
{
    public class UsuarioMap :  EntityTypeConfiguration<Usuario>
    {
        public UsuarioMap()
        {
            ToTable("TB_USER");

            HasKey(p => p.Id);

            Property(p => p.ContatoTelefonico).HasColumnName("CONTATO_USER").HasMaxLength(11);
            Property(x => x.Nome).HasMaxLength(60).IsRequired().HasColumnName("NOM_USER");
            Property(x => x.Password).IsRequired().HasColumnName("PASS_USER");
            Property(x => x.Email).IsRequired().HasMaxLength(100).HasColumnName("EMAIL_USER");
            Property(x => x.Documento).HasMaxLength(14).IsRequired().HasColumnName("DOC_USER");
            Property(x => x.DataNascimento).IsRequired().HasColumnType("Date").HasColumnName("DT_NASC");
            
        }
    }
}
